/* PDF Editor Specific Styles */

#pdf-editor-app {
    font-family: 'Arial', sans-serif;
}

/* Upload Section */
#upload-section .card {
    max-width: 500px;
}

/* Editor Section */
#top-bar .nav-tabs .nav-link {
    color: #495057;
}

#top-bar .nav-tabs .nav-link.active {
    color: #0d6efd;
    border-color: #dee2e6 #dee2e6 #fff;
}

#top-bar .dropdown-menu {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

/* Left Sidebar: Page Thumbnails */
#left-sidebar {
    background-color: #f8f9fa;
}

.thumbnail-item {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.thumbnail-item:hover {
    background-color: #e9ecef;
}

.thumbnail-item.active-thumbnail {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd !important;
}

.thumbnail-item canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

/* PDF Viewer */
#pdf-viewer {
    background-color: #e9ecef; /* Light gray background for the viewer area */
}

.pdf-canvas-container {
    width: 100%;
    height: 100%;
    overflow: auto; /* Ensure canvas is scrollable if larger than container */
}

#pdf-canvas {
    display: block; /* Remove extra space below canvas */
    margin: auto; /* Center canvas if smaller than container */
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* PDF Controls */
#pdf-controls {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

#pdf-controls .form-control,
#pdf-controls .form-select {
    font-size: 0.875rem;
}

/* Right Sidebar: History & Export */
#right-sidebar {
    background-color: #f8f9fa;
}

#right-sidebar h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

#right-sidebar .list-group-item {
    font-size: 0.875rem;
    background-color: transparent; /* Ensure list items don't obscure sidebar bg */
    border: none;
    border-bottom: 1px solid #e9ecef; /* Light separator */
}

#right-sidebar .list-group-item:last-child {
    border-bottom: none;
}

#export-button {
    font-size: 0.9rem;
}

/* General utility classes that might be helpful */
.vh-100 {
    height: 100vh;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure Font Awesome icons are sized appropriately if used directly in buttons */
.btn .fas {
    margin-right: 0.25em; /* Add some space if icon is before text */
}

/* Style for active tool button */
.btn.active-tool {
    background-color: #0d6efd;
    color: white;
    border-color: #0a58ca;
}

/* Ensure dropdowns in toolbars don't get cut off */
.btn-toolbar .dropdown-menu {
    position: absolute; /* Or 'fixed' if necessary, might need JS for positioning */
}

/* Responsive adjustments if needed */
@media (max-width: 992px) { /* Example breakpoint for tablets */
    #left-sidebar,
    #right-sidebar {
        width: 150px !important; /* Smaller sidebars on medium screens */
    }
    #pdf-controls .btn, #pdf-controls .form-control, #pdf-controls .form-select {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) { /* Example breakpoint for mobile */
    #main-content {
        flex-direction: column;
        height: auto !important; /* Allow content to dictate height */
    }
    #left-sidebar,
    #right-sidebar,
    #pdf-viewer {
        width: 100% !important; /* Full width for stacked layout */
        height: auto; /* Adjust height as needed */
    }
    #left-sidebar {
        max-height: 200px; /* Limit thumbnail height */
        margin-bottom: 0.5rem;
    }
    #right-sidebar {
        margin-top: 0.5rem;
    }
    .pdf-canvas-container {
        min-height: 300px; /* Ensure canvas area has some minimum height */
    }
    #pdf-controls {
        flex-wrap: wrap; /* Allow controls to wrap on small screens */
        padding: 0.5rem;
    }
    #pdf-controls > * {
        margin-bottom: 0.25rem; /* Add some spacing when wrapped */
    }
}